refactor TrackHiddenClass to make it faster