Update doc and clean the code