Expands use of track function. Fixes a bug

I didn't refactor a couple of function calls correctly.