optimizations to master branch