This commit makes some minor refactorings to improve the code readability and maintainability, including: - Avoiding code duplication. - Using more descriptive variable names. - Using `async/await` instead of `Promise#then()`. - Accessing variables directly instead of via `this` when possible. PR Close #42622