Refactored use of Then() extension method to use await.