[master] Improve template passing