refactor parents to store in db
more db optimizing