Extract helper to a table sort helper module