Improve logic of Custodian.