copy datahandler changes over from full-closure branch