upgrade add revision function and add template function