defining template separation of definitions, small fixes to tests