Improve exception handling and user input acceptance.