refactor log statements