Refactor and addition of gdt