Refactor dialog controller to start adding showBy functionality.