Clean up ViewEntityAction

* Remove redundant code.
* Make stuff private or protected if possible.
* More explicit comparisons.

Change-Id: I76fe3f3a0796adcdb0dd4f36c916c698b828db14