Updated MainController and MessageCollector classes