Improve conversion script