Small speed optimizations