sync code cleanup, more accurate stats