A funny Factory template implementation