Refactor Job tracking and statistics gathering