Refactor get downtime DB call