I think this would be cleaner if you returned a list of `get` and `set` functions.