Optimizations and code comments