small optimizations for cache