simplify elementAttributes; repair clearElement