move doctypid condition to behaviour