added common class for client and server