Factor parameter acceptance code into its own function.