metaprogramming: class with history