Use promise-chaining for cleaner code