Added metaprogramming by using dynamic method generation