Coproduct codec cleanup and auto coproduct generation