allow views hash to be function

Change-Id: I479ce1960cc7e12364822e7bc0fca74ebb8cabd0