Put events in separate functions and init function