Refactoring of control templates