Small refactorings
#541 Adding ModelOf to the DO library
And some small refactorings