hosting out var query to a wider scope