Cleaning up the optimizations a bit