DRYer way of handling incoming messages