apply metaprogramming to avoid code duplication for initializing sub DSL