More use of optional and friends