Better code for logging and timing
Better code for logging and timing