Convert Queue to template