refactored log