Refactor for pure function
Simplify
Merge pull request #2 from gavacho/refactor

Refactor