Renamed main.py to events.py
replaced memoized decorator with lru_cache
Minor refactoring in events.py: extracted method, added few comments.