move code from template in getdota.py