refactor code to use new logger lib