Rework the log system