Clean up and add doc.