reform the log functionality