Tidying up client and server