Refactored tracks.js