Relocated the process of retrieving messages as a common service for all controllers.