refactored fork_node and resolved todos