Error message for Windows + code refactoring + no need to declare closures as SerializableClosure