refactor integration