Update samples with the new logic

WARNING: Some samples won't work, they must to be redefined.