Delete duplicated code.
Update gitignore.