Trim Template Code