Template categories and small improvements