Cleaned up some comments and template definitions.