Move duplicated parse_value code into circuit class as static method