improved cleanup of filesystem