Update
Move code to widget class