optimize q creation a bit