move json to separate lib