move traverse to lib/helpers/