Factor out the code for choosing the bucket count, and which bucket that hash values map to make it easier to experiment with alternative policies.