move to json, remove legacy code