Test have been broken, TODO: write mocks and stubs