Extracted ViewFactory class for better reuse.

E.g., used in Node Preview.