The papers presented here cover two different themes, both with applications in life insurance. The focus in the first paper is on determining the financial position and performance of an insurance company, in a accordance with IFRS 17. To derive the financial performance of an insurance company one needs to determine how a premium paid should be earned over time, and how to measure the costs associated with this earned premium. This is a complex matter, since premium payments can provide many years of coverage, and claims payments often are not fully known until many years later. IFRS 17 suggests a way of doing this, by specifying how to measure the unearned future profit for a group of insurance contracts. We give a mathematical interpretation of the regulatory texts, resulting in an algorithm for profit or loss defined in terms of the change in this unearned future profit and the risk-based liability value. Furthermore, we suggest a multi-period cost-of-capital approach as an appropriate valuation method for this purpose, and illustrate the practicability of this method, and allocation of this value to subportfolios, in a large scale numerical example. The second paper concentrates on mortality forecasting, which is an important aspect of valuing and pricing life insurance contracts. We consider an extension of the Poisson Lee-Carter model, where the mortality trend is modelled by a long short-term memory neural network. Different calibration approaches of the network are suggested, with the aim of using training data efficiently, combined with ensembling to enhance the predictive performance. The stability of long-term predictions is improved by considering boosted versions of the model, which, furthermore, allows us to obtain reasonable predictions even for cases when data is very scarce.