refactored message receiver into two separate classes