Restructure and rewrite of tracker.