Improve tracking code