basic metaprogramming logic