finish first round of refactor playlist.js