** Refactored DOM handling to inside UI element logic