Expanded functionality and clean up utilities for temp files.