refactor of org.json classes