Feature/mob 2395 singleton

please move this code to a separate method ie. restoreChatState(), this method is too long