Code clean up & correctly use parent argumnent for widgets