Improved error checking and refactoring