create decoder for factory