Template gateway