refactor walker to reduce the complexity sligthly