adapt to class-based DOM