Moved hierarchical index queries to its own interface & class.