refactored integration test