work on refactoring stuff