Added tests
Fixed preparation refactoring