finish refactoring modelinstance classes to common base