Refactoring and cleaning up DomItem