Refactor for better logic, added ignored extensions.