move view-specific code into ui/view/*