Significantly clean up value parsing.