Logging improvement
Abstracted logic