Implemented local hasEvent logic
Formatting, cleanups