[#438] further fixes and cleaning

Moved all specific code to the parser to simplify the converter as much
as possible