metaprogramming and misc