using a factorial template