Battle state code cleaned up