Code cleaning
Prepare for logging