refactoring of UIA and its unit tests