Old code from Java wrapper for Pownce API