Code cleanup
Code optimizations