Code cleanup to remove duplication
Merge branch 'downtimes_mgmt' into dev