refactored cleanup to networkcleanup