refacord to support playlist editing