view pages code rationalized, functions moved to shared