Externalize the handle to getFiles

One method do one thing :)