Refactored end of typing event