Refactoring and fixes to playlist