refactors tests to pass