Move out message processing related code to own class