wip: refactore