Refactor out the battle debugger