finished refactoring for now