Factor out unneded stuff from widget module.