Merge "Move get_server_or_ip method to common class"