Rewrote high-level API.