Further refactorings towards promises