Refined Convert function