Some reordering in converter code.

This is still not very intuitive.