remove duplicate controller template code