refactor of pull request 4