The conditionals can probably be adjusted so that you don't check the same thing twice. for example, you are checking options.func on line 96 and line 98.