Refactor UIBean and ViewBean in preparation for #12454

Change-Id: Ie1510910ee692dc6a66deabcee4637e1e0ea944e