refactor now playing function