The definition of this method should be moved to a private method named `cast_value`.