refactor for ripple 0.2.0