Refactored method establishingConnectionToTheDatabaseToQuery and added comments to some classes