Finally, the toy example passes in one call
Refactoring the code