Refactoring fileset handling