Slightly improved generic view factory.