refactor class.db, addCategory.db