Re-added generics which were annoying me while refactoring the query hierarchy.