move view code to client only