form refactoring and template change