41fd343508 made a breaking change to the public API; this commit reverts the API changes but keeps the improved logic.
41fd343508