Updated to use Virtus for query classes so type checking and coercion is easier