Added mocks and tests