improved count and de tools