Remove defaultdict import.
Update import
Remove flask from core requirements