PXE refactor