Simplify event code.