Samples number refactored