optimizations found while profiling