updated view handling to use new api