Creating flexible database connection and using objects for menu items