remove conditional logic from while loop while preserving $@