repeated code again.

also, isn't handle the case where the optional is absent.