test
Refactoring and tests
merge