You would still need to set displayName and isValidValue, the same as in the else statement. There's no need for all of the if/else statements. If options is undefined, then we need to use the default values for everything, so just grab an object with all the default values. Then you don't need the if statements.