Refactor class rewrite for multishipping fix