new json encoding funds, cleanup