Made some adjustments in code when mocking