Refactored tracks js