shaper: rewrite queue-based