replace as_slice with slice sugar