make mocks return a function