Refactor CharDatabase.