Replaced the remaining hard coded accept methods with a template.