add a little bit of metaprogramming