better definition of templates