Refactoring.
Refactoring. Added specs.