Do some code refactoring in Config and Options.