Pass error threshold correctly
Update code to use extension methods