Long overdue addition of templates to cut down on repetitive code.