unit/integration test refactor