mid-refactoring