make renderer factory a function