Changed if-else to switch in Tracker