clean the code, fix diff of first commit retrieval