Refactored subquery classes and marked them as published to allow custom subqueries.