Improved externalize/internalize.