General refactoring. Moved some code in EventMatcher.