code clean + server connection fix