Move initializeProvider to isServerInteresting.

Remove repetitive code.

Change-Id: I0745ad89702f26abe0d6154230487a8b1b936277