WIP -- refactoring