improve replaceUI option