Made multi-threaded with Lwt threads