Refactor TypesDB