Refactor to move logic for spotify service to library