Refactored the DOM file