refactoring and fixes to UIA unit tests