refactor index ddl generator