scg and event db refactoring