implement recomendations of the pull request #777