At the top of this each function, you should set `key+sep+subKey` into a variable and use that variable throughout so that it's not doing the string concatenation dozens of times.