Refactoring template for latest style