Support multiple actions, more refactoring.