remove expand logic for to_primitive