Rewriting it with cleaner promises