removing dead code, minor refactor for get_files and get_directories