Refactored ladder client code