Refactor without DB classes and consistency between C/C++ pointers