refactor for model and domspe