Refactor cloud storage utility