Don't repeat yourself when computing (or elem js/document) and (name query)