Cleaning up the code and adding porper method to close the db connection
in ConnectToDb Class