replace b with type