Code clean up of datamodel and enumerations. Including refactoring,
renaming and commenting.