slight refactor of the class walking