Refactoring test mocks