clean up `walk` utils method