refator logging