tidying up traverser logic