Reworked closure in MainController