drop folder prefixes from file names
refactoring and add tests for empty nodes