Optimized code a bit.