Clear and refactor the code. Added UI functionality for changing the state after successful submit of order button when the user focus input field.