Refactor - add support for testnet