refactored server and clientside connection and user login experience