added factor span contraction template