broke message handling out of main