Add some function for pseudo_node and reduce duplication in construct.rs