More refactoring for common option code.
Moved common option set code.