- shifted tracking code into specialized function