Refactor code
Merge pull request #1 from rubenesc/extend

Refactor code