Statistic refactored
Refactored Gc logic and exception handling