View DDL Script function refactoring