mock refactoring