Message service refactoring