Removed unecessary flag
Refactored logging and stats aggregation