implemented metaprogramming