Refactor from pull request # 5