factor out Widget base class.