remove old unused code
fix loadleaf to work with workers