wip: starting work on refactoring