[REFACTOR] use FileUtils to improve teardown