refactoring log & log2