refactoring, moved a function from widget to node