refactoring and more UIA unit tests