refactor to separate simple utilities from monitoring scripts