refactored and updated integration tests