add more better logging and message formatting