Refactored handles and handle exceptions.