refactoring, updateMessages wip