a lot of refactoring and also a different workaround for MtGox sporadic "invalid call" bug