Cleaning up JSON input to main fn