Refactored the action/match factories into its own file.