Refactored Consul config script