adjusted to use optional::value_or_eval