Split/add and fixes

Might be better to define this function outside the enclosing function. It isn't capturing any variables, so defining it every time that `strip_key` is called seems like a waste.