Finished refactor into helper.ml
More work in client.ml and server.ml