Renaming and documenting.
Removed duplicate types and added some documentation.