Refactor MainCtrl with messageService