Improve binary interface and add doc.