Some light metaprogramming to be DRY-er