Add possibility to customize the threshold value