Separated Server and Client to refactor both sides