Added return function support for mocking