refactor & add fetching json from s3