Samples refactoring and documentation improvements