implemented mocking of functions