Refactor similar method structure in dirs and files into one for re-use.
By using the name of the method calling fs_command we remove duplication
Merge pull request #2071 from jonahoffline/refactor_pkg_duplication

Refactor similar method structure in dirs and files into one for re-use.
remove use of caller