lift loop bodies in a separate method