add logging crate
pass payload by reference, clarify logging