make_allies.js refactoring