Replace to_option() with as_ref()