Refactor fetchDirections()