move lua binarytree args handling into lua script