seems like this could mostly be reduced to an .index() call on get_sorted_actions() or a derivative thereof