Convert script: refactor.