Refacto and add different folder types
Added recursivity for directories