Anis' D3D9 Refactoring