Adjust promises handling and identation