Created generic message function to do the boring work