Extract the extra_options logic
WIP for generalized extra_option