refactoring integration test and passing