DOM handling as class