[ocaml] tidy up codes