Refactoring the mock creation call