streamlining the change function