[CORE][DB] code cleanup, added database