cleaned up some of the trackeditor.js code