refactor UIElement