Cleaned up bandit testing internal logic