Moved the resultBlock and failureBlocks out of the method.