blah
slight refactoring