Moved Query execution logic & added factory method for NodeList