Anis' DX9 Refactoring