refactored functions to not have parameter list of nodes anymore.