modularize the db and its objects