Refactor DX code - beginning.
Few more test things in main.

Signed-off-by: moose51789 <moose51789@gmail.com>