db refactor
daemon init