added facility for sorting facts and action defs