Refactoring mock