refactored ast walker in separate file