Refactored log