common functions used by polargold