remove redundant loop
fix typo
Merge pull request #275 from y-tag/refactoring

Trivial refactoring