Apply small optimizations