Use sqlalchemy expression to delete orphans.
typo: same var name.
Split line into word to make gram.
Split function.
Remove dependency between functions.