improve threshold methods