Review and refactor tasks of chapter1-2