small optimizations and removed outdated comments