refactored UiCodeGenerator