Improve php version of the converter