Perhaps, we can also provide Promise type as argument to make this function more general and useful.