Some mathematical aspects of reinsurance