Split out client and server parts