Refactor integration