internal optimizations