Refactor assign_playlist.js