added viewer for client and optimized server viewer.