Some optimizations and remove tabs