WIP: yet another refactoring