more refactoring to distinquish between node and widget