make threshold a config parameter, make maxHistory a shared config parameter