Database class design