Finalize sample with a maximum of code hidden by  the framework.