refactoring
Minor performance improvements
glah