Code refactoring for database classes.