single method for label parsing