Improve testfile helper