refactoring with coinbase python library