refactor logs