move log functions to utils
add some helper functions