These 3 functions are confusing.  The output factory should be creating the output, not being used in this way (see other comment)