wip: refactor