MessageReceiver refactoring

Refactor MessageReceiver so that inheritants contain less code.