Refactor - move log functions to common library