Stat: Cleanup filtering code