performance enhancement and bandit fix