Enhance material parsing logic.