Split out in server dir in preperation for browser code