refactor of filtering robot actions, untested.