refactored tests into unit/integration