Refactor using the static instantiated conenction object and add better logging