simple code to detect template objects