refactor: use proc to reshape input JSONs