Some changes to logger
Optimized