Refractoring to commond code between applications
Remove temporary file