refactor domain framework