API improvements from Jan's review.