Initialize tabs and attach models using a generalized logic.
Add test coverage