pull request #218, clean code