split optimizations into separate classes