minimize widgets code