WIP minor refactoring