File cleanup and context cleaning