Code tidying in Widget class