refactoring di solver e test, corretti memory leak