Removed duplicated code
Merge pull request #920 from marcosgdf/refactor

Removed duplicated code