I agree that the mucking around with flatMap, toInt and Option is unpleasant, but I felt changing  `maxAge` to a Long was unnecessarily intrusive and my scala isn't strong enough to know if there's a nicer way of achieving the rest.