refactor openvpn code