started factoring out common msg processing