simplified tree walking for data- attributes, removed a few conditionals