Probably worth wrapping some of these lines in to methods to give a clear picture of what's happening here. Like, `get_most_recent_files_in_bucket`, etc.