Refactor messaging util class