move ast traversal code
reorganized runtime