Refactoring GridView.prototype.setMode so it's not just a switch block. There's now a GridMode object with extensions for each discrete mode. So now GridView.prototype.setMode just needs to disable the old GridMode and enable the new GridMode.