Updated with enhanced value parsing