refactoring and such