Refactored to run in Ripple