Better way to update value