remove unnecessary objects in widgets