Split into common, client and server parts