better leverage Hash#each for metaprogramming