Fix function construct and remove temporary function getParentXX