wip - splitting into client and server