Generated outputting factories, cleaned writer code