Metaprogramming and Refactoring