Revise prioritize_* functions
Complete conversion of calc_int module