rewrite with vector type