move different playback modes into separate functions