refactorize code shipment