organize code files, refine similarity calulating code