Cleanup and getFiles implementation