refactor file list functions