Refactor change server dialog