Added a switch statement in process_node method