Created a server utility class and moved the server communication logic into it