Refactored message receiving into event system