Move common function to remove temporary files to Surrogate parent class