some improvements, handle all server's options.