re-factoring the databaseManager

Making the databaseManager singleton class