Refactoring to connected model