Issue #2

Refactor of previous solution