Added Template Scanner logic