switch segments to optional