refactor tests (do not use so many stubs and mocks)