add template for tf calculation