refactoring of net and txscapy utils