Refactor theme option processing