wip refactor