Refactor convert(), see comments on pull request #52.