Remove unused types, add some doc.