Improve threshold controller