renamed handleInputs to userEvents