Refactoring using enumeration.
Merge pull request #1 from sferrini/master

Refactoring using enumeration.