remove tree directive and add getFiles function