fixed tests
refactored integration tests