smal refactoring, performance, minimize calls