Set values instead of building hashes with single values for merging
Get rid of useless temp variable
Avoid hash lookups for building an array of required defaults

Only set the value once after it's calculated.