rewrite dom class