refactoring scaffold templates