On a unified framework for sampling with and without replacement in