more refactor before unification