more idiomatic use of optional