refactor to include uploading to AWS