Splitting the events into separate listener functions