Some speed optimizations.
10% faster