Add the beginning of a level 2 optimizations and move closure to level 3