extracted logging to a module