Refactored to allow toggling between TestNet and MainNet