glob tests + refactoring