wip: refactoring