Optimized code a little.