Large refactoring of the conversion tool: first step