relations to json
rename function
remove useless code