Refactor lib/getFiles and builder a little bit.
Merge pull request #95 from arian/refactor-getFiles

Refactor lib/getFiles