message formating & logging & exceptions handling