Refactor pull request #7