improved as_typed_vector