improve $q usage