Refactor ignoreExtension into more powerful and simplified: ignore