Refactoring: introduct stop() function for dealing with exit on failures.