Removed useless code in walk() method