preparation for reduction of the nesting of a large function