add json
cleanup code