revised template router