Moved track! function
Factored clean-up code out of event constructor