Adapted latest eventric changes, Some refactoring and cleanup