Rewrite interface and add docs.