Optimized code. Code clean up.