def get_events_and_selectors(kwargs):
    """Extract events and corresponding selectors from kwargs."""
    events = {
        key: kwargs.pop(key) for key in list(kwargs.keys()) if key.startswith("on_")
    }
    selectors = {key: f"<{key[3:].upper()}>" for key in events}
    return events, selectors