Fixes for tests
Refactoring
Refactoring