separated code for nonopt tests