Mock refactoring