Simplified API, adapted implementations (not finished).