Some optimizations and comment updates