Code refactor, Improve alliance/base selection