Some clean up and add doc.