log system refactored