better architecture for view handling