Refactored console logging