Change naming and minor modification to improve readablity
shell.c: remove unneeded iteration in find_events()