refactored log event and relations