change API for leavesOnly/asStrings