resolve nested "defun"s