Changed refreshValues to only update DOM for fields that have changed value or visibility.