map model keep currently selected in place when collapsed - refactored