refactor playlist plugin