Split events to own functions