Performance improvements
Refactoring