improved internalize/externalize