def extract_bool(
        params: dict,
        key: str,
        default: bool,
) -> bool:
    """Safely extract boolean value from user input."""
    value = params.get(key)

    if value is None:
        result = default
    else:
        result = value == 'on'

    return result