Nifty little function for selecting message types