Moved some view creation to a factory class.