Preliminary refactoring