Added callback functionality for mocking