optimize template call