refactor database layer, and add table dao for register a table and add default values for the table items