Major refactoring of custodian. Not yet working...