introduced promises to clarify control flow