refactored message service