Refactored zgd package