Could the other code which performs this task be factored out into a function and just called here if the options don't look right?