replaced widget logic with widget context