Factor out an tap listener