Generalize to use the same directive for track and set list