finialize the comment, refactor some code