split out worker message handling
separated grid section and function