Replace id with type