The files are left on disk for 5 seconds before being deleted. This is risky and less performant. Could the file be removed in a tail method call instead of an arbitrary 5 seconds?