Refactors filtering and sorting of array elements with 'ActionOrder'