Refactor size threshold check to take a block that defines how to check the size to compare the threshold against