WIP -- refactor the refactoring patch