better handling of optionals