KeyError handling, Shipment.currency property, refactoring