Implements available, adds text received event, refactor.