Refactor Action, per new names.ActionTag changes...

... and to improve internal structure.
I'm not sure what the rest of this function is doing, but it feels wrong already.