Little refactoring. Using best practices. Adding more tests.