refactoring createNode to create parent persistent nodes if not exist