Refactoring just for test-ability