optimizations on code front