Refactored and simplified "GraphUtilities.Parse" method