A little speed optimizations