Broke out the logic for health checks