update tmeplates and remove debug functions