replaced special handling with general matching and typed operators