Update converter.js

refactoring