Refactoring for pull request #99