Some model refactoring