implement proper algorithm for choosing a suitable swapToken; refactor