slightly micro-optimized qtree