some refactoring in fetch request promise chain