added mocks and tests