Changed `threshold` into stored variable

Change `threshold` into a member variable of the Frame. Will move
somewhere else in future.