minor modification

remove useless dependence, simplify code and add comments