Dom refactor