Some cleanup to Formatter

* Move dismiss checking logic to event
* Remove unnecessary variables

Change-Id: If224fe6d668788e779109ee96ac28d44faa4b41b
Merge "Some cleanup to Formatter"