use Base Class UiElement and it's virtual function to reduce code this tech called Polymorphic