refactoring out garbage method