Use a function to do the grunt work