Move getPathFromRoot to MenuItem