Replace "null" management with optionals.