Changed construction of UI and Window to be static methods of the struct