Refactor events compare