Extract logic to create priority function into separate class.
Cleanup TableResizeHelper
Add TODO comment. More tweaking needed for priority function.