Refactor Main, Impl DBEntsafter
Revert "Refactor Main, Impl DBEntsafter"

This reverts commit fdadb9fe88aade048b226ab0ed7f3423b7f634fa.
Refactor Main, Impl DBEntsafter
Refactor Main, Impl DBEntsafter
DBEntsafter