Code refactor and adding DDL syntax