Updating build/test methods to use terminate fucntion which automatically handles auth denied

...