Factorial functions are now template.